/**************************************************************************//**
 * @item     CosyOS Kernel
 * @file     os_var.c
 * @brief    系统全局变量定义
 * @author   迟凯峰
 * @version  V3.3.3
 * @date     2023.09.12
 ******************************************************************************/

#include "os_redef.h"

/* The Soft-RTC */
#if SYSCFG_SOFTRTC == __ENABLED__
volatile  tsEvery             _SYS_MEM_   vEvery = {0, 0, 0, 0, 0, 0};
          u8                  _SYS_MEM_   vRealTime[7] = sInitRealTime;
          u8                  _SYS_MEM_   vMonth2Date  = 28;
const     u8                _CONST_MEM_   cMonthDate[13] = {31, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
#endif
/* The Task */
volatile  tBIT                            vRET_f = true;
volatile  tBIT                            vScheduling_f = false;
          tTimeSharing        _SYS_MEM_   vTickCounter = 0;
          tECODE              _SYS_MEM_   vACTRET = ECODE_NOERR;
          tspTaskHandle       _SYS_MEM_   vACTBUF = (tspTaskHandle)0;
          tspTaskNode         _SYS_MEM_   vTASKING = NULL;
          tspTaskNode         _SYS_MEM_   vTPLTAIL = NULL;
          tDelay                          vDELAY_STMR [OS_TASKTOTAL + 1];
#if SYSCFG_SAFERUNTIME == __ENABLED__
          bool                            vOVERTIME   [OS_TASKTOTAL + 1];
#endif
#if SYSCFG_TIMESHARINGMODE == 2
const     tTimeSharing      _CONST_MEM_   vTIMESHARING[SYSCFG_TASKPRIORITY] = {SYSCFG_CUSTOMTIMESHARING};
#endif
/* The Timing Interrupt-Task/Hook */
#if OS_TIMINTTOTAL
          bool                            vTIMINT_ARLD[OS_TIMINTTOTAL];
          bool                            vTIMINT_TYPE[OS_TIMINTTOTAL];
          tspTimIntHandle                 vTIMINT_THDL[OS_TIMINTTOTAL];
          tTimInt                         vTIMINT_STMR[OS_TIMINTTOTAL];
          tTimInt                         vTIMINT_BUFF[OS_TIMINTTOTAL];
#endif
/* The Timing Query-Task/Hook */
#if OS_TIMQRYTOTAL
          bool                            vTIMQRY_ARLD[OS_TIMQRYTOTAL];
          bool                            vTIMQRY_TYPE[OS_TIMQRYTOTAL];
          tspTimQryHandle                 vTIMQRY_THDL[OS_TIMQRYTOTAL];
          tTimQry                         vTIMQRY_STMR[OS_TIMQRYTOTAL];
          tTimQry                         vTIMQRY_BUFF[OS_TIMQRYTOTAL];
#endif
/* The Global Variable */
          tspVarNode          _SYS_MEM_   vVarNode = NULL;
#if SYSCFG_MCUCORE == 8051
volatile  tBIT                            os_sign_write_var_write = false;
#endif
/* The Message Mailbox */
#if SYSCFG_MAILBOX == __ENABLED__
          tspMbxNode          _SYS_MEM_   vMbxNode = NULL;
#if SYSCFG_MCUCORE == 8051
volatile  tBIT                            os_sign_write_mbx_write = false;
#endif
#endif
/* The Direct Message */
#if SYSCFG_DIRMSG == __ENABLED__
volatile  tBIT                            vSendDM_f = false;
#endif
/* The Debug Interface */
#if SYSCFG_DEBUGGING == __ENABLED__
          tsAlarm                         vAlarm = {0, 0, 0, 0};
          tsFault                         vFault = {0, 0, 0, 0, 0, 0, 0, 0};
          char              _DEBUG_MEM_   vDebugRecvBuff[OS_DEBUGRECVBUFFSIZE];
          char _DEBUG_MEM_ *              vDebugRecvPtr = vDebugRecvBuff;
volatile  u8                              vDebugSendFlag = 0;
          char _DEBUG_MEM_ *              vDebugSendPtr;
          char              _DEBUG_MEM_   vCmdLineSendBuff[OS_CMDLINESENDBUFFSIZE];
          char              _DEBUG_MEM_   vTaskmgrSendBuff[OS_TASKMGRSENDBUFFSIZE];
volatile  bool                            vTaskmgrBinary = SYSCFG_TASKMGRAUTOSTART;
#if SYSCFG_STKTIMECOUNT == __ENABLED__
          u32                             vSTK_Counter1 = 0;
          u32                             vSTK_Counter2 = 0;
#endif
#if SYSCFG_TASKPCMONITOR == __ENABLED__
          tPC                             vPC = 0;
#endif
#endif
/* The Task Critical */
#if SYSCFG_TASKCRITICAL == __ENABLED__
volatile  u8                  _SYS_MEM_   vTaskCritical = 0;
#endif
